package com.example.wanandroid.ui.adapter;

import android.content.Context;
import android.view.View;

import com.example.wanandroid.R;
import com.example.wanandroid.core.bean.navigation.NavigationListData;
import com.zhengsr.tablib.view.adapter.TabFlowAdapter;

import java.util.List;

/**
 * @author jiangyi
 */
public class NavCategoryItemAdapter extends TabFlowAdapter<NavigationListData> {
    Context context;


    public NavCategoryItemAdapter(int layoutId, List<NavigationListData> data, Context context){
        super(layoutId,data);
        this.context = context;

    }

    @Override
    public void bindView(View view, NavigationListData data, int position) {
        setText(view, R.id.item_text,data.getName());
//        setTextColor(view, R.id.item_text, context.getResources().getColor(R.color.colorText));
    }

    @Override
    public void onItemSelectState(View view, boolean isSelected) {
        super.onItemSelectState(view, isSelected);
        if (isSelected){
            setTextColor(view, R.id.item_text, context.getResources().getColor(R.color.color_rank_tag_text));
        }else {
            setTextColor(view, R.id.item_text, context.getResources().getColor(R.color.color_rank_game_tag));
        }
    }

}
